package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties("handler")
public class Comment extends BaseDomain{

    private String content;

    //评论的日期
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;

    //点评人
    private User commentator;

    private Integer star;

    private Integer type;

    //评论所关联的游记对象
    private Travel travel;

    //已发布的攻略
    private Strategy releasedDetail;

    //冗余字段维护评论的点赞次数
    private List<String> likeNums = new ArrayList<>();

    //冗余字段维护子评论的次数
    private List<String> subComms = new ArrayList<>();

    //冗余字段用于维护游记评论的游记作者名称
    private String travelNickName;

    private boolean isViewed = false;


    //评论的所有回复数,冗余字段
    private Integer ofCommentNums;

    //评论点赞数,冗余字段
    private Integer commentLikers;

}